<div class="page">
        <?php
            $content = heading($page['pag_title'], 1);
            $content .= '<p>' . $page['pag_content'] .'</p>';
            if ($page['hasDocuments']) {
                //$content .= heading('Documente', 2);
                $content .= '<div class="documents">';           
                foreach ($page['documents'] as $document) {
                    $content .= renderDocumentListEntry($document, 'document');
                }
                $content .= '</ul>';
                $content .= $page['links'];
            } else if ($page['hasActiveAuctions']) {
                //echo heading('Documente', 2);
                $content .= '<div class="auctions">';           
                foreach ($page['activeAuctions'] as $auction) {
                    $content .= renderAuctionListEntry($auction, 'auction');
                }
                $content .= '</div>';
                $content .= '<p>' . $page['links'] . '</p>';
            }  else if ($page['hasInactiveAuctions']) {
                //echo heading('Documente', 2);
                $content .= '<div class="auctions">';           
                foreach ($page['inactiveAuctions'] as $auction) {
                    $content .= renderAuctionListEntry($auction, 'auction');
                }
                $content .= '</div>';
                $content .= $page['links'];
            }
            echo $content;
        ?>
    </div>
</div>
